package edu.chinasoft.servlet;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter;
import javax.servlet.annotation.WebServlet;
import org.apache.log4j.Logger;

/**
 *
 * @author liuyunhe
 * @date 2020年2月24日:下午8:36:06
 * @version V1.0
 * @Description: 
*/
@WebServlet(name="myTest01",value="/servlet/Test01")
public class  Test01  extends HttpServlet {
	private static Logger logger = Logger.getLogger( Test01 .class);
	
	/**
	 */
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		logger.debug(" Test01 >doGet start.......");
		response.setContentType("text/html;charset=utf-8");
		request.setCharacterEncoding("utf-8");
		PrintWriter out = response.getWriter();
		
		String mimeType = this.getServletContext().getMimeType("ab.json");
		System.out.println(mimeType);
		
		
		logger.debug(" Test01 >doGet end.......");
	}
	
	/**
	 *
	 */
	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		logger.debug(" Test01 >doPost start.......");
		this.doGet(request, response);
		
		logger.debug(" Test01 >doPost end.......");
	}
	
}